Initiating a Transaction with the Java Library
JumioClient has two methods that provide fluent builder interfaces for initiating a transaction:
-
initiateNewAccount()
for initiating a transaction for a new account. -
addNewWorkflowToExistingAccount()
for initiating a transaction for an existing account.
The builder steps provide a simple way to configure an account request.
Example: Initiate a Transaction for a New Account
The following snippet shows the fluent builder interface you can use to initiate a transaction for a new account:
WebResponse webResponse = jumioClient.initiateNewAccount(FluentBuilderWorkflows.STANDALONE_ID_VERIFICATION_10015) .customerInternalReference("my_company") .callbackUrl("https://myserver.mycompany.com/callback") .withDefaultCredentials() .performWeb(new WebSettings() .successUrl("https://jumio.com/success") .errorUrl("https://jumio.com/failure"));
.
Example: Initiate a Transaction for an Existing Account
The following snippet shows the fluent builder interface you can use to initiate a transaction for an existing account:
jumioClient.addNewWorkflowToExistingAccount(FluentBuilderWorkflows.fluentWorkflow(Workflows.workflow(10025)), accountId) .customerInternalReference(reference.toString()) .callbackUrl(JUMIO_CALLBACK_PUBLIC_URL) .withDefaultCredentials() .performWeb(new WebSettings() .successUrl("https://jumio.com/success") .errorUrl("https://jumio.com/failure"));
Builder Steps
Builder Method | Parameters | Description | Return Type |
---|---|---|---|
or
|
FluentBuilderWorkflow<T> accessed as static object from FluentBuilderWorkflows.
|
FluentBuilderWorkflows provides static references to pre-defined objects for standard Jumio workflows. |
CustomerReferenceBuilderStep<T> |
customerInternalReference()
|
String | String that identifies your organization. | CallbackUrlBuilderStep<T> |
|
String |
String representation of the URL to use for the Callback. If you do not need a callback enter |
|
withDefaultCredentials()
or
|
No parameters or List<CredentialRequest> credentials |
or
|
or |
performWeb()
or
|
or |
Use a new WebSettings with no additional configuration to use the defaults configured in the Jumio Portal Settings. Optionally, you can override the successUrl and errorUrl by setting the appropriate values, as shown in the examples below. or |
or |
JumioClient
also has a getAccountAPI()
method that returns an AccountApi object you can use if you require more detailed configuration.
WebResponse
The WebResponse object provides access to both the configured AccountRequest and the AccountResponse containing the values returned by Jumio. For example, you can extract the web URL and use it to launch the Web Client. See Returning the Jumio Web Client.